package dao.sqlmap;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import model.Address;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;

import dao.AddressDAO;

public class AddressSQLMapDao extends SqlMapDaoTemplate implements AddressDAO {

	// 1)SqlMapDaoTemplate繧堤ｶ呎価縺励※縺�ｋ縲�

	private static final String GETALLADDRESSES = "getAllAddresses";
	private static final String GETNEWLIST = "getNewList";

	public AddressSQLMapDao(DaoManager dm) {
		super(dm);
	}

	public List<Address> getAllAddresses(String keyword) throws SQLException {
		
	    
		List<Address> list = queryForList(GETALLADDRESSES,keyword);

		for (int i = 0; i < list.size(); i++) {
			Address address = (Address) list.get(i);

		}

		return list;
	}
public List<Address> getNewList() throws SQLException {
		
	    
		List<Address> list = queryForList(GETNEWLIST,null);

		for (int i = 0; i < list.size(); i++) {
			Address address = (Address) list.get(i);

		}

		return list;
	}


	

}
